<?php
namespace App\Http\Controllers\CmsApi;

use Illuminate\Http\Request;
use App\Lib\Response;
use App\Http\Model\Hint;
use App\Http\Controllers\BaseController;
use App\Http\Services\UserServices;
use App\Http\Services\UnionServices;

class InnerUnionController extends BaseController
{
    protected $userService;
    protected $unionService;

    public function __construct()
    {
        $this->userService = new UserServices();
        $this->unionService = new UnionServices();

    }

    /**
     * 设置公会奖励类型
     */
    public function unionSetRewardType(Request $request)
    {
        $unionId = (int) $request->post('union_id');
        $rewardType = (int) $request->post('reward_type');
        if(empty($unionId)) {
            Response::returnResult(Hint::PARAM_ERROR);
        }

        $data = $this->unionService->unionSetRewardType($unionId, $rewardType);
        Response::returnResult($data['code'], $data['data'], $data['msg']);
    }

}